import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
	{
		path: "/custinfo",
		name: "custinfo",
		meta: {
			deepth: 1,
			isFefresh: false,
			keepAlive: false, // 需要被缓存
		},
		component: (resolve) => require(["@/views/order/CusMessage.vue"], resolve),
		children: [],
	},
	{
		path: "/inforentry/:prodId",
		name: "inforentry",
		meta:"信息录入手写页面",
		meta: {
			deepth: 1,
			isFefresh: false,
			keepAlive: false, // 需要被缓存
		},
		component: (resolve) => require(["@/views/order/InforEntry.vue"], resolve),
		children: [],
	},
	{
		path: "/inforentryppm",
		name: "inforentryppm",
		meta:"信息录入",
		meta: {
			deepth: 1,
			isFefresh: false,
			keepAlive: false, // 需要被缓存
		},
		component: (resolve) => require(["@/views/order/InforEntryPPM/index.vue"], resolve),
		children: [],
	},
	{
		path: "/orderentryppm/:prodId/:serviceOfferId/:modType/:optionId",
		name: "orderentryppm",
		component: (resolve) => require(["@/views/order/orderEntryPPM/index.vue"], resolve),
		children: [],
	},
	{
		path: "/orderadd",
		name: "orderadd",
		meta:"新建项目",
		meta: {
			deepth: 1,
			isFefresh: false,
			keepAlive: false, // 需要被缓存
		},
		component: (resolve) => require(["@/views/order/OrderAdd.vue"], resolve),
	},
	{
		path: "/bgorderadd",
		name: "bgorderadd",
		meta:"变更项目保存",
		component: (resolve) => require(["@/views/order/BgOrderAdd.vue"], resolve),
	},
	{
		path: "/continuechange",
		name: "continuechange",
		meta:"继续变更",
		component: (resolve) => require(["@/views/order/ContinueChange.vue"], resolve),
	},
	{
		path: "/custorder",
		name: "custorder",
		meta:"订单任务处理与跟踪",
		component: (resolve) => require(["@/views/order/CustOrder.vue"], resolve),
		children: [],
	},
	{
		path: "/ordertemp",
		name: "ordertemp",
		component: (resolve) => require(["@/views/order/orderTemp.vue"], resolve),
		children: [],
	},
	{
		path: "/productinfo",
		name: "productinfo",
		component: (resolve) => require(["@/views/order/productInfo.vue"], resolve),
		children: [],
	},
	{
		path: "/flowChart",
		name: "flowChart",
        meta:"流程图页面",
		component: (resolve) => require(["@/components/custorder/flow-chart/index.vue"], resolve),
		children: [],
	},
	{
		path: "/progressChart",
		name: "progressChart",
        meta:"服开流程图页面",
		component: (resolve) => require(["@/components/custorder/progress-chart/index.vue"], resolve),
		children: [],
	},
  {
		path: "/process-maintain",
		name: "process-maintain",
    meta:"流程维护",
		component: (resolve) => require(["@/views/order/process/maintain.vue"], resolve),
		children: [],
	},
	{
		path: "/localTariffVerify",
		name: "localTariffVerify",
        meta:"甲端本地资费核实弹窗",
		component: (resolve) => require(["@/views/order/dialog/AocalTariffVerifi.vue"], resolve),
		children: [],
	},
	{
		path: "/charges",
		name: "charges",
        meta:"资费核实弹出",
		component: (resolve) => require(["@/views/order/dialog/Charges.vue"], resolve),
		children: [],
	},
	{
		path: "/filInResources",
		name: "filInResources",
        meta:"填报资源",
		component: (resolve) => require(["@/views/order/dialog/FilInResources.vue"], resolve),
		children: [],
	},
	{
		path: "/BusOppoTaskList",
		name: "BusOppoTaskList",
		component: (resolve) => require(["@/views/order/BusOppoTaskList/index.vue"], resolve),
	},
    {
        path: "/opportunityTask",
        name: "opportunityTask",
        component: (resolve) => require(["@/views/order/opportunityTask.vue"], resolve),
        children: [],
    },
	{
        path: "/dialogExample",
        name: "dialogExample",
        component: (resolve) => require(["@/views/order/dialog/dialogExample.vue"], resolve),
        children: [],
    },
	{
        path: "/ordersStatistics",
        name: "ordersStatistics",
        component: (resolve) => require(["@/views/order/statistics/index.vue"], resolve),
        children: [],
    },
    {
        path: "/InterfaceByBusiPage",
        name: "InterfaceByBusiPage",
				meta: "服开订单重发",
        component: (resolve) => require(["@/views/order/interfaceBy/InterfaceByBusiPage/index.vue"], resolve),
        children: [],
    },
	{
		path: "/govProdOrderSendAgPage",
		name: "govProdOrderSendAgPage",
		meta: "两级DCOOS订单下发",
		component: (resolve) => require(["@/views/order/interfaceBy/govProdOrderSendAgPage/index.vue"], resolve),
		children: [],
	},
	{
		path: "/TestSendRestPage",
		name: "TestSendRestPage",
		meta: "两级订单下发",
		component: (resolve) => require(["@/views/order/interfaceBy/TestSendRestPage/index.vue"], resolve),
		children: [],
	},
    {
        path: "/productMation",
        name: "productMation",
        meta: "产品实例库信息",
        component: (resolve) => require(["@/views/order/productMation.vue"], resolve),
        children: [],
    },
	  {
        path: "/mytest",
        name: "mytest",
        meta: "测试页",
        component: (resolve) => require(["@/views/order/mytest.vue"], resolve),
        children: [],
    },
];

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes,
	// scrollBehavior(to, from, savedPosition) {
	//     // keep-alive 返回缓存页面后记录浏览位置
	//     if (savedPosition && to.meta.isKeepAlive) {
	//         setTimeout(() => { //延时
	//             window.scrollTo(savedPosition.x, savedPosition.y)
	//         }, 10);
	//     }
	//     // 异步滚动操作
	//     return new Promise((resolve) => {
	//         setTimeout(() => {
	//             resolve({ x: 0, y: 1 });
	//         }, 0);
	//     });
	// }
});
export default router;
